using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter01
{
	/// <summary>
	/// Example01: How many atoms in the cube?
	/// A solid cube of aluminum has a volume of 0.2 cm^3. 
	/// It is known that 27 g of aluminum contains 6.02\times 10^23
	/// atoms. How many aluminum atoms are contained in the cube? 
	/// Answer:1.20525243449336E+22
	/// </summary>
	public class Example01
	{
		public Example01()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.Atom al = new L.Atom();
			al.AtomNumber = 13;
			al.Find();

			L.Volume v = new L.Volume();
			v.Magnitude = 0.2; // cgs
			v.mCUBE = L.Unit.cgsTOmks(v);

			L.Density rho = new L.Density();
			rho.Magnitude = 2.7; // cgs
			rho.kgPERmCUBE = L.Unit.cgsTOmks(rho);

			L.Mass m = new L.Mass(rho,v);
		
			double res = L.Unit.mksTOcgs(m)/al.AtomicMass
				*L.Constant.AvogadroConstant;
			result += Convert.ToString(res);
		}
	}
}
